/*
 * @Author: duchengdong
 * @Date: 2021-12-27 18:52:08
 * @LastEditors: lizhen
 * @LastEditTime: 2021-12-29 16:14:08
 * @Description:
 */
import {requestAuth, requestNoAuth} from '@/request/request'

// 微信鉴权code接口获取用户openId和unionId
export async function wxLoginByCodeApi(code) {
	const url = `/maopen/user/login/${code}`
	return await requestNoAuth({
		url,
		method: 'GET',
	})
}

//刷新Token
export async function refreshTokenApi(refreshToken) {
	const url = `/maopen/user/refreshToken?refreshToken=${refreshToken}`
	return await requestNoAuth({
		url,
		method: 'GET',
	})
}

// 手机号授权
export async function authPhoneApi(data) {
	const url = `/maopen/user/phone`
	let res = await requestAuth({
		url,
		method: 'POST',
		data,
	})
	return res
}
